define(["require", "exports", "./CommonFunction", "./GlobalClass", "./EventDefinition", "./MianCanvasClass"], function (require, exports, CommonFunction_1, GlobalClass_1, EventDefinition_1, MianCanvasClass_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    /**右顶部功能框类 */
    class RightTopClass {
        constructor() {
            this.InitFunc();
        }
        /**初始化 */
        InitFunc() {
            this.RightTop = CommonFunction_1.CommonFunction.ins().IdToElement("topFunc");
            GlobalClass_1.GlobalClass.ListenerCenter.addEvent(EventDefinition_1.EventDefinition.CLICK, this.RightTop, this.onClick.bind(this));
            GlobalClass_1.GlobalClass.FileDisposClass.BindLabelDrop(this.DropElem, "bottomFunc", this.RightTop);
        }
        /**标记选中的元素
        * @param ele_select 选中元素
        * @param ele_parent 标签所在的父对象
        */
        TagElement(ele_select, ele_parent) {
            //判断中的标签是否在指定父节点内
            if (ele_select.parentElement == ele_parent) {
                ele_select.style.backgroundColor = "#f6aff2";
            }
        }
        onClick(event, e) {
            let curr_Id = e.path[1].id;
            //若上次有选择图块对象则将其背景重置为白色
            if (this.CurrentElem != null) {
                if (this.CurrentElem.parentElement == this.RightTop) {
                    this.CurrentElem.style.backgroundColor = "#ffffff";
                }
            }
            this.CurrentElem = e.path[1];
            this.TagElement(this.CurrentElem, this.RightTop);
            MianCanvasClass_1.MainCanvasClass.ins().SettingImage(this.CurrentElem.childNodes[0]);
        }
    }
    exports.RightTopClass = RightTopClass;
});
